<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>登入系统 - FireEye</title>
  <link rel="shortcut icon" href="__PUBLIC__/favicon.ico">
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
  <link rel="stylesheet" href="__PUBLIC__/layui/css/layui.css" media="all">
</head>
<body>
  <div class="layui-fluid">
    <div class="layui-card">
      <div class="layui-card-body" style="padding-top: 20px;">
        <div class="layui-form" action="" lay-filter="component-form-group">
            <div class="layui-form-item">
              <label class="layui-form-label">密码</label>
              <div class="layui-input-block">
                <input type="password" name="newpass" lay-verify="required" placeholder="请输入新密码" autocomplete="off" class="layui-input">
              </div>
            </div>
            <div class="layui-form-item">
              <label class="layui-form-label">重复一遍</label>
              <div class="layui-input-block">
                <input type="password" name="re_newpass" lay-verify="required" placeholder="请再次输入新密码" autocomplete="off" class="layui-input">
              </div>
            </div>

            <div class="layui-form-item">
              <label class="layui-form-label"></label>
              <div class="layui-input-block">
                <button class="layui-btn" lay-submit lay-filter="edit-submit">修改</button>
              </div>
            </div>
        </form>
      </div>
    </div>
  </div>
  <script src="__PUBLIC__/layui/layui.js"></script>  
  <script>
  layui.use(['layer', 'form'], function(){
    var form = layui.form
        ,$ = layui.$;

    //提交
    form.on('submit(edit-submit)', function(obj){
      if(obj.field.newpass != obj.field.re_newpass){
        layer.msg("两次输入的密码不匹配");
        return;
      }
      $.post("/User/Ajax/ajax_repass" , JSON.stringify(obj.field) ,function(d){
        layer.msg(d.msg, {
            time: 1500,
            end: function() {
              if(d.error == 0){
                parent.layer.close(parent.layer.getFrameIndex(window.name)); // 关闭当前 iframe 的弹出层
              }
            }
        });
      },"json");
    });
  });
  </script>
</body>
</html>